package com.jiji.miaosha.mapper;

import com.jiji.miaosha.entity.UserPassword;
import com.jiji.miaosha.mapper.provide.UserPasswordMapperProvider;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserPasswordMapper {

    @Select("select * from user_password where user_id=#{userId}")
    UserPassword queryPasswordByUserId(@Param("userId") Integer userId);

    @InsertProvider(type = UserPasswordMapperProvider.class, method = "upSert")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "password.id")
    int upSert(@Param("password") UserPassword userPassword);
}
